import 'package:flutter_magic_planet/common/http/api_comic_pingcc.dart';
import 'package:flutter_magic_planet/model/comic.dart';
import 'package:get/get.dart';

class ComicListLogic extends GetxController {
  String? query;
  String? option;
  final comics = <Comic>[].obs;

  @override
  void onInit() {
    query = Get.parameters['query'];
    option = Get.parameters['option'];
    fetchList();
    super.onInit();
  }

  fetchList() async {
    var _data = await APIComicPingcc.getComics(option: option!, key: query!);
    comics.value = _data;
  }
}
